package com.andy.note.boot.model.entity.doctor;

import java.util.Date;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.andy.note.boot.config.mpjson.ApproveStatusTypeHandler;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author andy
 * @since 2021-07-30
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value="abc", autoResultMap = true)
public class ABC extends Model<ABC> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField(value = "source")
    private String source;
    
    @TableField(value = "approve_status", typeHandler = ApproveStatusTypeHandler.class)
    private List<ApproveStatus> approveStatus;
    
    @TableField(value = "status", typeHandler = FastjsonTypeHandler.class)
    private ApproveStatus status;
    
    public static void main(String[] args) {
        ABC a = new ABC();
        ApproveStatus status = new ApproveStatus();
        status.setActivityName("1");
        status.setApproveStatus("1");
        status.setAssignee("1");
        status.setSubmitDate(new Date());
        a.setStatus(status);
        System.out.println(JSON.toJSONString(a));
    }
}
